﻿using System.Windows;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;
using Okazuki.BehaviorSupport.Silverlight.Design.Types;
using Okazuki.BehaviorSupport.Design.Commons.Editors;
using Microsoft.Windows.Design.PropertyEditing;

[assembly: ProvideMetadata(typeof(Okazuki.BehaviorSupport.Silverlight.VisualStudio.Design.BehaviorSupportRegister))]
namespace Okazuki.BehaviorSupport.Silverlight.VisualStudio.Design
{
    /// <summary>
    /// ビヘイビア系のサポートを追加する
    /// </summary>
    internal class BehaviorSupportRegister : IProvideAttributeTable
    {
        public AttributeTable AttributeTable
        {
            get
            {
                var builder = new AttributeTableBuilder();
                builder.AddCustomAttributes(
                    SilverlightTypes.FrameworkElementType,
                    new FeatureAttribute(typeof(BehaviorPrimarySelectionContextMenuProvider)));
                builder.AddCustomAttributes(
                   SilverlightTypes.EventTriggerType,
                   "EventName",
                   PropertyValueEditor.CreateEditorAttribute(typeof(EventNamePropertyEditor)));
                return builder.CreateTable();
            }
        }
    }
}
